home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / dos_win / winsock / maillist / 94-03.Z / 94-03 / text0349.txt < prev    next >
Encoding:
Text File  |  1994-03-30  |  1.3 KB  |  34 lines

  1. >   1) Set the SO_KEEPALIVE socket level option.  This will send an empty
  2. >      message every 45 seconds (BSD) and expect a response within 6
  3. >      minutes (BSD).  If it times out the next operation on the socket
  4. >      should fail.
  5.  
  6. Be careful, though.  RFC 1122 "Hosts Requirements" says the default
  7. timeout between keepalives is 2 hours.  If that doesn't sound too
  8. useful you're right, it's not supposed to be.  The implication is
  9. that Keep Alives are considered evil and should be avoided.  Your
  10. mileage can vary greatly between TCP/IP implemenations.
  11.  
  12. You are much better off using you're own timer and sending your own
  13. keepalive ("are you there"/"yes I'm here") type messages.
  14.  
  15. >   2) The asynch select doesn't get notified if a timeout happens unless
  16. >      you have written data to the socket (speculation here).
  17.  
  18. If a keep-alive generates a reset when the other end of a connection
  19. has apprently gone away (i.e. it's stopped responding to keepalives)
  20. then a message should be posted (take your pick which message, any
  21. of them can contain an error).
  22.  
  23. >I just have
  24. >      a timer that tries to write data every once in a while to make
  25. >      sure a timeout hasn't occurred.
  26.  
  27. In this case, you don't need keep-alives.
  28.  
  29. Regards,
  30. --
  31.  Bob Quinn                                             rcq@ftp.com
  32.  FTP Software, Inc.                                No. Andover, MA
  33.  
  34.